# -*- coding: utf-8 -*-
import json
class TableConfig:
    mappings={}
    mappings["retailProducts"]={"name": "retailProducts","columns":[{
          "title": "商品编码",
          "key": "ProductCode"
        },{
          "title": "商品名称",
          "key": "ProductName"
        },
        {
          "title": "颜色",
          "key": "Spec1Name"
        },
        {
          "title": "尺码",
          "key": "Spec2Name"
        },
        {
          "title": "吊牌价",
          "key": "PriceList"
        },
        {
          "title": "零售价",
          "key": "RetailPrice"
        },
        {
          "title": "折扣",
          "key": "Discount"
        },
        {
          "title": "应收价",
          "key": "ReceivablePrice"
        },
        {
          "title": "数量",
          "key": "Qty"
        },
        {
          "title": "实收价",
          "key": "ActualPrice"
        },
        {
          "title": "实收金额",
          "key": "Price"
        },
        {
          "title": "营业员",
          "key": "Saler"
        },
        {
          "title": "销售类型",
          "key": "RetailType"
        },
        {
          "title": "推广类型",
          "key": "PromotionType"
        },
        {
          "title": "条码",
          "key": "BarCode"
        }]}

def get_tablecolumns(_name=''):
    columns=[]
    res={}
    try:
        columns=TableConfig.mappings[_name]["columns"]
        res["code"]=0
        res["message"]=""
        res["data"]=columns
    except Exception as e:
        res["code"] = -1
        res["message"] = e
        res["data"] = columns
    return res

if __name__=="__main__":
    print(get_tablecolumns('retailProducts'))